limsOutsourceApply.searchPage = {

    getGridParam: function () {
        var _this = this
        return {
            type: 'grid',
            id: 'lims-outsource-apply-search-list-grid',
            url: limsOutsourceApply.baseUrl + '/queries/searchable',
            columns: limsOutsourceApply.getSearchListColumns(),
            onCellClick: function (field, row) {
                field === 'applyCode' && _this.loadDetailPage(row.id)
            },
            page: true,
        }
    },

    create: function () {
        var _this = this
        Gikam.create('layout', {
            id: 'lims-outsource-apply-search-list-layout',
            renderTo: workspace.window.$dom,
            center: {
                items: [this.getGridParam()]
            }
        })
    },

    loadDetailPage: function (id) {
        workspace.window.load(limsOutsourceApply.baseUrl + '/page/detail' + Gikam.param({
            id: id,
            step: 'search'
        }))
    },

    init: function () {
        this.create()
    }
}
